#include<iostream>
using namespace std;
int n, k, a, b;
int main()
{
	cin >> n >> k >> a >> b;
	int ans1 = (n - 1) * a;
	int ans2 = (k - 1) * b + (n - 1) * b;
	if (ans1 > ans2) {
		cout << 2 << endl;
	}
	else if (ans1 == ans2) {
		cout << 0 << endl;
	}
	else {
		cout << 1 << endl;
	}
	return 0;
}